﻿<%@ Page Language="C#" MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="Categories.aspx.cs"
    Inherits="cms_Properties" Title="<%$Resources:Language,CmsCategoriesTitle %>" ValidateRequest="false"
    EnableEventValidation="false" %>

<%@ Register Src="../controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/ctrlCategoryTreeView.ascx" TagName="CategoryTreeView"
    TagPrefix="ctrl" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="ctrl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">

    <script language="javascript" type="text/javascript" src="../Javascript/Common.js"></script>

    <ctrl:ctrlWait ID="ctrlWait" runat="server" />
    <asp:UpdatePanel ID="upDDl" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hfEditMode" runat="server" Value="false" />
            <h2>
                <%= Resources.Language.CategoryEdit %>
                <%= SelectedCategoryID > 0 ? " ID"+SelectedCategoryID.ToString() : ""  %>
            </h2>
            <div id="CategoryEdit">
                <uc1:ctrlShowInfo ID="CtrlShowInfo" runat="server" />
                <div class="InlineBox">
                    <ctrl:CategoryTreeView ID="tvCategory" runat="server" OnSelectedNodeChange="tvCategory_SelectedNodeChanged"
                        ShowImportance="true" NodeSelectAction="Select" RootSelectAction="None" />
                </div>
                <div class="InlineBox">
                    <div class="Controls">
                        <span class="peBoxLeft"></span><span class="peBoxRight">
                            <asp:Button ID="btnNewCategoryTop" runat="server" Text="<%$Resources:Language,NewCategory %>"
                                OnClick="btnNew_Click" CausesValidation="False" />
                            <asp:Button ID="btnChangeTop" runat="server" Text="<%$Resources:Language,SaveChanges %>"
                                OnClick="btnChange_Click" />
                            <asp:Button ID="btnRemoveTop" runat="server" Text="<%$Resources:Language,DeleteUpper %>"
                                OnClick="btnRemove_Click" CausesValidation="False" />
                        </span>
                    </div>
                    <div id="editPanel" runat="server">
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%= Resources.Language.Lang %>: </span><span class="peBoxRight">
                                    <asp:DropDownList ID="ddlLanguage" runat="server" DataTextField="Name" DataValueField="LanguageID"
                                        AutoPostBack="True" OnSelectedIndexChanged="ddlLanguage_SelectedIndexChanged"
                                        CssClass="DropDownShort">
                                    </asp:DropDownList>
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.ParentCategory %>: </span><span class="peBoxRight">
                                    <asp:DropDownList ID="ddlParent" runat="server" AppendDataBoundItems="True" CssClass="DropDownWide">
                                    </asp:DropDownList>
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.Name %>: </span><span class="peBoxRight">
                                    <asp:TextBox ID="tbCategoryName" runat="server" CssClass="TextInputWide"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvCategoryName" runat="server" ErrorMessage="*"
                                        ControlToValidate="tbCategoryName"></asp:RequiredFieldValidator>
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.Description %>: </span><span class="peBoxRight">
                                    <asp:TextBox ID="tbDescription" runat="server" TextMode="MultiLine" CssClass="TextInputMultiline"></asp:TextBox>
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.Weigth %>: </span><span class="peBoxRight">
                                    <asp:TextBox ID="txtWeight" runat="server" CssClass="TextInputShort"></asp:TextBox>&nbsp;
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.Active %>: </span><span class="peBoxRight">
                                    <asp:CheckBox ID="chbActive" runat="server" />
                                </span>
                        </div>
                        <div class="vSeparate">
                            <span class="peBoxLeft">
                                <%=Resources.Language.View %>: </span><span class="peBoxRight">
                                    <asp:DropDownList ID="ddlViews" runat="server" DataTextField="Title" DataValueField="ViewId">
                                    </asp:DropDownList>
                                </span>
                        </div>
                        <div class="Controls">
                            <span class="peBoxLeft"></span><span class="peBoxRight">
                                <asp:Button ID="btnNewBottom" runat="server" Text="<%$Resources:Language,NewCategory %>"
                                    OnClick="btnNew_Click" CausesValidation="False" OnClientClick="ScrollTop();" />
                                <asp:Button ID="btnChangeBottom" runat="server" Text="<%$Resources:Language,SaveChanges %>"
                                    OnClick="btnChange_Click" OnClientClick="ScrollTop();" />
                                <asp:Button ID="btnRemoveBottom" runat="server" Text="<%$Resources:Language,DeleteUpper %>"
                                    OnClick="btnRemove_Click" CausesValidation="False" OnClientClick="ScrollTop();" />
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
